//
//  WBMTMainController.m
//  WBMTwaimai
//
//  Created by WangBiao on 16/9/21.
//  Copyright © 2016年 lsrain. All rights reserved.
//

#import "WBMTMainController.h"
#import "WBMTOrderController.h"

/*
    需求：默认运行程序后跳到点餐Vc
 
 */
@interface WBMTMainController ()

@end

@implementation WBMTMainController

#pragma make - 搭建界面
- (void)setupUI{
    //测试控制器
    self.view.backgroundColor = [UIColor whiteColor];
    
    //添加add按钮
    UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeContactAdd];
    [self.view addSubview:addBtn];
    [addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
    }];
    
    //点击按钮跳转到点餐VC
    /*addTarget是添加给了运行循环（运行循环检测事件）*/
    [addBtn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
}

- (void)btnClick{
    
    WBMTOrderController *orderVC = [[WBMTOrderController alloc] init];
    [self.navigationController pushViewController:orderVC animated:YES];
}

- (void)viewWillAppear:(BOOL)animated{
    
    self.navigationController.navigationBar.alpha = 1;
    ///测试方法，默认跳到点餐界面
    [self btnClick];
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
